﻿using KinonekoSoftware.Expressions.Core;

namespace KinonekoSoftware.Expressions.Headings
{
    public sealed class TextHeader : ExpressionBlockNode, ITextHeader
    {
        private int    _level;
        private string _header;
        
        public override ExpressionNode Generate()
        {
            return new TextHeader
            {
                Id = GetID(),
                Level = Level,
            };
        }

        /// <summary>
        /// 获取或设置 <see cref="Header"/> 属性。
        /// </summary>
        public string Header
        {
            get => _header;
            set => SetValue(ref _header, value);
        }

        /// <summary>
        /// 当前的标题等级。
        /// </summary>
        public int Level
        {
            get => _level;
            set => SetValue(ref _level, value);
        }
    }
}